{% extends 'user/user_base.html' %}

{% block page_title %}用户注册{% endblock %}

{% block content_title %}用户注册{% endblock %}

{% block form %}


    <form action="" method="post">
     {% csrf_token %}


        <div class="form-group">
            {{ form.email.label_tag }}
            {{ form.email }}

            {% if form.email.errors %}
                {% for error in form.email.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>


        <div class="form-group">
            {{ form.password.label_tag }}
            {{ form.password }}
                  {% if form.password.errors %}
                {% for error in form.password.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>


        <div class="form-group">
            {{ form.password2.label_tag }}
            {{ form.password2 }}
                  {% if form.password2.errors %}
                {% for error in form.password2.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>

        <div class="form-group">
            {{ form.captcha.label_tag }}
            {{ form.captcha }}
                  {% if form.captcha.errors %}
                {% for error in form.captcha.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>



        <button type="submit" class="btn btn-primary">注册</button>
        <a class="btn btn-secondary" href="{% url 'user:login' %}" role="button">已有账号，去登录</a>
    </form>

{% endblock %}